package com.java.atm.Account;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

public class User implements Serializable
{
    private String UserName;
    private  String passWord;
    private int userId;
    public SavingAccount savingAccount;
    public CheckAccount checkAccount;

    public User(ResultSet rs)
    {
        try
        {
            rs.last();
            UserName = rs.getString("user_name");
            checkAccount = new CheckAccount(rs.getDouble("balance"), rs.getDate("lst"));
            userId = rs.getInt("id");
            savingAccount = new SavingAccount(rs.getDouble("hbalance"), rs.getDate("lhst"),
                                                rs.getDouble("obalance"), rs.getDate("lost"),
                                                rs.getDouble("fbalance"), rs.getDate("lfst"));
        }catch(SQLException e)
        {
            e.getErrorCode();
        }

    }


    public int getUserId()
    {
        return userId;
    }

    public String getUserName()
    {
        return UserName;
    }



}
